//
//  ICMineNetworkManager.m
//  ICome
//
//  Created by zhangrongwu on 16/9/26.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "ICApplicationNetworkManager.h"

@implementation ICApplicationNetworkManager

+(instancetype)sharedInstance {
    static ICApplicationNetworkManager *manager;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        manager = [[ICApplicationNetworkManager alloc] init];
    });
    return manager;
}


// 待办确认
- (void)gtaskConfirmurl:(NSString *)url
                success:(HttpSuccessCompletionHandle)success
                failure:(HttpFailureCompletionHandle)failure {
    [ICNetworkHelper POST:url parameters:nil success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        failure(error);
    }];
}
// 待办驳回
- (void)gtaskRejecturl:(NSString *)url
               success:(HttpSuccessCompletionHandle)success
               failure:(HttpFailureCompletionHandle)failure {
    [ICNetworkHelper POST:url parameters:nil success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

// 应用jsticket
- (void)getJsTicketWithObject:(NSDictionary *)param
                      success:(HttpSuccessCompletionHandle)success
                      failure:(HttpFailureCompletionHandle)failure {
    NSString *url = [self appendRequestBaseURL:@"licensor/ticket"];
    [ICNetworkHelper POST:url parameters:param success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

// 校验jsapiverify
- (void)jsapiverifyWithObject:(NSDictionary *)param
                      success:(HttpSuccessCompletionHandle)success
                      failure:(HttpFailureCompletionHandle)failure {
    NSString *url = [self appendRequestBaseURL:@"licensor/jsapiverify"];
    [ICNetworkHelper POST:url parameters:param success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        failure(error);
    }];
}
@end
